import { deepCopy } from '../../utils/tool'
const state = {
  menuList: [],
  currentMenu: []
}

const defaultState = deepCopy(state)

const getters = {
  menuList: state => state.menuList,
  currentMenu: state => state.currentMenu
}

const mutations = {
  RESET_MENU (state) {
    state = defaultState
  },
  SET_MENU (state, list) {
    state.menuList = list
  },
  SET_CURRENT_MENU (state, list) {
    state.currentMenu = list
  }
}

const actions = {}

export default {
  state,
  getters,
  mutations,
  actions
}
